package us.du.result;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
 * Created by zhangcheng
 */
@Data
@ApiModel(value = "返回结果")
public class ResultData<T> implements Serializable{

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "状态码")
    private String code;
    @ApiModelProperty(value = "状态描述")
    private String msg;
    @ApiModelProperty(value = "数据")
    private T data;

    public ResultData(){}

    public ResultData(String code, String message){
        this.code = code;
        this.msg = message;
    }

    public ResultData(String code, String message, T result){
        this.code = code;
        this.msg = message;
        this.data = result;
    }
}